/**
 * Urban Parks
 *
 * Team M&M's:
 * Michael Satran Jr
 * Michael Pogson
 * Stephen Hunter
 *
 * Date: Mar 5, 2012
 */
package tests;

import static org.junit.Assert.*;

import model.Date;
import model.Job;
import model.Volunteer;

import org.junit.Before;
import org.junit.Test;

/**
 * @author Stephen Hunter
 * @author Winter 2012
 *
 */
public class ModelTest {

	Job my_job1;
	
	Job my_job2;
	
	Job my_job3;
	
	Volunteer my_v1;
	
	Volunteer my_v2;
	
	Volunteer my_v3;
	
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		
	my_job1 = new Job(new Date(5,31,2012), new Date(5,31,2012), "h", 1);
	my_job2 = new Job(new Date(5,31,2012), new Date(5,31,2012), "h", 1);
	my_job3 = new Job(new Date(5,31,2012), new Date(5,31,2012), "g", 1);
	
	my_v1 = new Volunteer("K", "L", "2", "D", false);
	my_v2 = new Volunteer("K", "L", "2", "D", false);
	my_v3 = new Volunteer("K", "L", "2", "F", false);
	
	}
	
	/**
	 * Tests equals method for jobs.
	 */
	@Test
	public void testJobEquals() {
		assertTrue(my_job1.equals(my_job2));
		assertFalse(my_job1.equals(my_job3));
	}
	
	/**
	 * Tests the exception for the job's equals method.
	 */
	@Test(expected=IllegalArgumentException.class)
	public void testJobEqualsException() {
		my_job1.equals(null);
	}
	
	/**
	 * Tests equals method for volunteers.
	 */
	@Test
	public void testVolunteerEquals() {
		
		assertTrue(my_v1.equals(my_v2));
		assertFalse(my_v1.equals(my_v3));
	}
	
	/**
	 * Tests the exception for the volunteer's equals method.
	 */
	@Test(expected=IllegalArgumentException.class)
	public void testVolunteerEqualsException() {
		my_v1.equals(null);
	}
}
